
var do_url='http://lr.mangcaoiot.com/';

$("#weui-btn_primary").click(function(){
    $.toast('提交成功');
    /*var iccid = $("#iccid").val();
    var customer = $("#customer").val();
    var incharge = $("#incharge").val();
    var tel = $("#tel").val();
    var address=$("#address").val();
    var active_time=$("#active_time").val();
    var package_type=$("#package_type").val();
    var promoter=$("#promoter").val();
    $.ajax({
        type: 'POST',
        dataType: "json",
        url: do_url+"/api/status/add-information",
        data:"iccid="+iccid+'&customer='+customer+'&incharge='+incharge+'&tel='+tel+'&address='+address+'&active_time='+active_time+'&package_type='+package_type+'&promoter='+promoter,
        success: function(data) {
            if(data.code==200){
                $.toast(data.message);
            }else{
                $.toast(data.message, "forbidden");
            }

        }
    });*/
    
    
})
/*$("#weui-btn_update").click(function(){
    
    var tel = $("#tel").val();
    if(tel){

    }
    $.toast('提交成功');
    var id = $("#id").val();
    if(!id){
       $.toast('参数有误', "forbidden"); 
    }
    var iccid = $("#iccid").val();
    var customer = $("#customer").val();
    var incharge = $("#incharge").val();
    var tel = $("#tel").val();
    var address=$("#address").val();
    var active_time=$("#active_time").val();
    var package_type=$("#package_type").val();
    var promoter=$("#promoter").val();

    $.ajax({
        type: 'POST',
        dataType: "json",
        url: do_url+"/api/status/info-edit",
        data:"iccid="+iccid+'&customer='+customer+'&incharge='+incharge+'&tel='+tel+'&address='+address+'&active_time='+active_time+'&package_type='+package_type+'&promoter='+promoter+'&id='+id,
        success: function(data) {
            if(data.code==200){
                $.toast(data.message);
            }else{
                $.toast(data.message, "forbidden");
            }

        }
    });
    
    
})*/
    
$("#doLogin").click(function(){
    var username = $("#username").val();
    var password = $("#password").val();
    $.ajax({
        type: 'POST',
        dataType: "json",
        url: do_url+"/api/status/promot-login",
        data:"username="+username+'&password='+password,
        success: function(data) {
            if(data.code==200){
                //$.toast(data.message);
                //console.log(data);
                location.href="index.html";
            }else{
                $.toast(data.message, "forbidden");
            }

        }
    });
});
function loginOut(){
    $.ajax({
        type: 'POST',
        dataType: "json",
        url: do_url+"/api/status/loginout",
        success: function(data) {
            if(data.code==200){
                $.toast(data.message);
                location.href="login.html";
            }

        }
    });
}